package com.learner.course.controller.api;

import com.learner.course.service.DictionaryService;
import com.learner.pojo.course.dictionary.SysDictionaryValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ice2020x
 */
@RequestMapping("/api/edu/dictionary")
@RestController
public class ApiDictionaryController {

    @Autowired
    DictionaryService dictionaryService;

    /**
     * 获取字典
     *
     * @param value value
     * @return 结果
     */
    @GetMapping("/get/{value}")
    public SysDictionaryValue getByType(@PathVariable("value") String value) {
        return dictionaryService.findDictionaryByType(value);
    }
}
